feat(session): persist message IDs, reply threading, and author identity in session history#1709
Open
dimonb wants to merge 12 commits intosipeed:mainfrom
Open
feat(session): persist message IDs, reply threading, and author identity in session history#1709dimonb wants to merge 12 commits intosipeed:mainfrom
dimonb wants to merge 12 commits intosipeed:mainfrom
Conversation
Contributor
Author
|
Hi, guys. The idea of this PR is to preserve more information in the session history to give the LLM more context to implement threading, reactions, etc. My plan is to gradually submit more PRs to the community to support reactions, more complex history compaction, and other cool features that I’ve implemented in my fork. It’s a little messy right now and needs some improvements in loop.go, so I’ll wait. |
359fcfa to
273ea9c
Compare
8898497 to
be8c87b
Compare
…Sender Replace the optional MessageIDsSender interface with a direct return value on Send. Channels that support delivery IDs (Telegram, Discord, Slack, QQ) return them from Send; all others return nil. Manager.sendWithRetry drops the type-assertion branch and calls Send uniformly.
- Remove unused messageThreadAnnotation (superseded by messageHistoryAnnotation) - Remove unused publishResponseIfNeeded (superseded by publishAgentResponseIfNeeded) - Reformat fakeChannel method alignment broken by Send signature change - Wrap long line in steering_test.go
… ambiguity with IDs
3f37ec6 to
4d267d9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Persists structured metadata alongside messages in JSONL session history so the LLM can navigate thread structure and address participants by name across restarts.
What this adds:
MessageIDs []stringandReplyToMessageIDonproviders.Message— session history preserves thread structure instead of flattening conversations to plain textReplyToMessageIDpromoted to a first-class field onbus.InboundMessage(was metadata-only); Telegram now populates it frommessage.ReplyToMessagemessage_idwhen appended to historymessage_idcan be stored inMessageIDs; placeholder edits count as deliveredMessageSender{Username, FirstName, LastName}struct stored with user messages — surfaced to the LLM as[from:Alice Example (@alice); msgs:#5,#6; reply_to:#3]annotations on history replayFirstName/LastNameextracted from Telegram user and stored inbus.SenderInfoChannel.Sendnow returns([]string, error)instead oferror— delivered message IDs flow back throughOutboundMessage.OnDelivered; theMessageIDsSenderoptional interface is removedSend; all others returnnilbus.MessageBus.SubscribeOutboundhelper added (blocks until next outbound message or ctx done)🗣️ Type of Change
🤖 AI Code Generation
🔗 Related Issue
📚 Technical Context (Skip for Docs)
MessageIDs/ReplyToMessageIDin the JSONL store, the LLM cannot reconstruct thread structure after a restart. Without storing assistant delivery IDs, outbound turns still lose their platform identity after restart. WithoutMessageSender, it cannot address participants by name.🧪 Test Environment
📸 Evidence (Optional)
Click to view Logs/Screenshots
All existing tests pass (
go test ./...) and lint passes (make lint).☑️ Checklist